package com.soda.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.soda.bean.Information;
import com.soda.service.InformationServiceHan;
import com.soda.service.impl.InformationServiceHanImpl;

public class InformationServletHan extends HttpServlet {

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		InformationServiceHan is = new InformationServiceHanImpl();
		String met =request.getParameter("met");
		if("1".equals(met)){
			String inftitle =new String( request.getParameter("infTitle").getBytes("ISO-8859-1"),"utf-8");
			//System.out.println(inftitle);
			Information infor =is.getinfTitleSelect(inftitle);
			request.setAttribute("informations", infor);
			request.getRequestDispatcher("qiantai/information.jsp").forward(request, response);
			
		}
		
		

		
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		doGet(request, response);

		
	}

}
